package com.qifei.xmlg_backend.exception;

import com.qifei.xmlg_backend.entity.ErrorCode;
import org.checkerframework.checker.units.qual.C;

public class CustomException extends RuntimeException{

    private final int code;
    public CustomException(ErrorCode errorCode){
        super(errorCode.getMessage());
        code = errorCode.getCode();
    }

    public CustomException(int code, String message) {
        super(message);
        this.code = code;
    }

    public int getCode() {
        return code;
    }
}
